<!DOCTYPE html>

<html>

<head>
    <!-- 页面meta -->

    <meta charset="utf-8">

    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <title>后台管理</title>

    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">

    <!-- 引入样式 -->

    <link rel="stylesheet" href="../plugins/elementui/index.css">

    <link rel="stylesheet" href="../plugins/font-awesome/css/font-awesome.min.css">

    <link rel="stylesheet" href="../css/mystyle.css">
    <!-- 引入组件库 -->

    <script src="../js/vue.js"></script>

    <script src="../plugins/elementui/index.js"></script>

    <script type="text/javascript" src="../js/jquery.min.js"></script>

    <script src="../js/axios-0.18.0.js"></script>

    <script src="../http/request.js"></script>


</head>

<body class="hold-transition">
    <div id="app">
        <div class="app-container">
            <div class="box">

                <div class="filter-container">

                    <div class="margin-left-small">
                        <el-date-picker v-model="value1" type="daterange" range-separator="至" start-placeholder="开始日期"
                            end-placeholder="结束日期" style="margin-right: 20px;">
                        </el-date-picker>
                    </div>

                    <el-button type="primary" @click="getByNumber()" class="dalfBut">查询</el-button>

                </div>

                <el-table size="small" current-row-key="id" :data="dataList" stripe highlight-current-row>

                    <el-table-column prop="id" type="index" align="center" label="序号"></el-table-column>

                    <el-table-column prop="phone" label="发单手机号" align="center"></el-table-column>

                    <el-table-column prop="createTime" label="发单时间" align="center"></el-table-column>

                    <el-table-column prop="amount" label="悬赏金额" align="center"></el-table-column>

                    <el-table-column prop="address" label="送达地址" align="center"></el-table-column>

                    <el-table-column prop="expectTime" label="期望送达时间" align="center"></el-table-column>

                </el-table>

                <!-- 编辑标签弹层 -->

                <div class="add-form">

                    <el-dialog title="编辑检查项" :visible.sync="dialogFormVisible4Edit">

                        <el-form ref="dataEditForm" :model="formData" :rules="rules" label-position="right"
                            label-width="100px">

                            <!-- <el-row>
                                <el-col :span="12">
                                    <el-form-item label="订单号" prop="number">
                                        <el-input v-model="formData.number" />
                                    </el-form-item>
                                </el-col>

                                <el-col :span="12">
                                    <el-form-item label="接单手机号" prop="phone">
                                        <el-input v-model="formData.phone" />
                                    </el-form-item>
                                </el-col>
                            </el-row>

                            <el-row>
                                <el-col :span="12">
                                    <el-form-item label="订单类型">
                                        <el-input v-model="formData.productId" type="address"></el-input>
                                    </el-form-item>
                                </el-col>

                                <el-col :span="12">
                                    <el-form-item label="悬赏金额">
                                        <el-input v-model="formData.amount" type="address"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row> -->

                            <el-row>
                                <el-col :span="12">
                                    <el-form-item label="订单状态">
                                        <el-input v-model="formData.orderStatus" type="address"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col>
                                    <span style="color: red;">
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;使用说明：改为0，取消订单</span>
                                </el-col>
                            </el-row>

                        </el-form>

                        <div slot="footer" class="dialog-footer">
                            <el-button @click="dialogFormVisible4Edit = false">取消</el-button>
                            <el-button type="primary" @click="handleEdit()">确定</el-button>
                        </div>

                    </el-dialog>

                </div>

            </div>

        </div>

    </div>

</body>



<script>
    var vue = new Vue({

        el: '#app',
        data: {
            value1: '',
            pagination: {},
            dataList: [],//当前页要展示的列表数据
            formData: {},//表单数据
            dialogFormVisible: false,//控制表单是否可见
            dialogFormVisible4Edit: false,//编辑表单是否可见
            rules: {//校验规则
                type: [{ required: true, message: '帮手类别为必填项', trigger: 'blur' }],
                name: [{ required: true, message: '帮手电话号为必填项', trigger: 'blur' }]
            }
        },

        //钩子函数，VUE对象初始化完成后自动执行
        mounted() {
         
        },
        methods: {
            getByNumber() {
                //发送ajax请求
                axios.get("/order/getByTime?start=" + this.convert(this.value1[0]) + "&end=" + this.convert(this.value1[1])).then((res) => {
                    console.log(this.value1[0])
                    console.log(this.value1[1])
                    this.dataList = res.data;
                });
            },
            convert(time){
                const date = new Date(time)
                return date.getTime();
            },
           
        },
    })

</script>

</html>